﻿/*****************************************************************//**
 * @file    FITKGraphObjectMeshPart.h
 * @brief   Graph object for part data.
 * 
 * @sa
 * FITKColorMap FITKColorMapManager FITKGraphObjectModelHighlighting
 *  
 * @author  ChengHaotian (yeguangbaozi@foxmail.com)
 * @date    2024-03-20
 *********************************************************************/

#ifndef __FITKGRAPHOBJECTMESHPART_H__
#define __FITKGRAPHOBJECTMESHPART_H__

#include "FITKGraphObjectMeshModelBase.h"

#include "FITKVTKGraphAdaptorAPI.h"

// Forward declaration
class vtkActor;

namespace AbaqusData
{
    class FITKAbaqusPart;
}

namespace Exchange
{
    /**
     * @brief   Graph object for 'part'.
     * @author  ChengHaotian (yeguangbaozi@foxmail.com)
     * @date    2024-03-25
     */
    class FITKVTKGRAPHADAPTORAPI FITKGraphObjectMeshPart : public FITKGraphObjectMeshModelBase
    {
        // Regist
        FITKGraphObjectRegist(FITKGraphObjectMeshPart, FITKGraphObjectMeshModelBase);
        FITKCLASS(Exchange, FITKGraphObjectMeshPart);

    public:
        /**
         * @brief   Constructor.
         * @param   caseData: The case data
         * @param   part: The mesh part data.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-03-20
         */
        FITKGraphObjectMeshPart(AbaqusData::FITKDataCase* caseData, AbaqusData::FITKAbaqusPart* part);

        /**
         * @brief   Destructor.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-03-20
         */
        ~FITKGraphObjectMeshPart() = default;

        /**
         * @brief   Set the graph actors to the default color.[override]
         * @param   forceUpdate: Force update the color mode
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-05-09
         */
        void colorByDefault(bool forceUpdate = false) override;

        /**
         * @brief   Set the graph actors with the material's color.[override]
         * @param   forceUpdate: Force update the color mode
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-04-01
         */
        void colorByMaterial(bool forceUpdate = false) override;

        /**
         * @brief   Set the graph actors to the section's color.[override]
         * @param   forceUpdate: Force update the color mode
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-04-01
         */
        void colorBySection(bool forceUpdate = false) override;

        /**
         * @brief    Set the graph actors to the default property color.[override]
         * @param   forceUpdate: Force update the color mode
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-04-02
         */
        void colorByDefaultProperty(bool forceUpdate = false) override;

        /**
         * @brief   Set the mesh color by the mesh module.[override]
         * @param   forceUpdate: Force update the color mode
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-12-13
         */
        void colorByDefaultMesh(bool forceUpdate = false) override;

    private:
        /**
         * @brief   Generate the actor with the part data.
         * @param   part: The part data
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-06-04
         */
        void generateGraph(AbaqusData::FITKAbaqusPart* part);

    };
}   // namespace Exchange

#endif // __FITKGRAPHOBJECTMESHPART_H__
